<template>
  <div>
    <div class="box" v-for="time in arr" :key="time.id">
      <div class="img">
        <img :src="time.imgs" />
      </div>
      <div class="txt">
        <h2>{{ time.h2 }} | {{ time.pingfang }}</h2>
        <p>{{ time.xiaoqu }} {{ time.p }}</p>
        <div class="span">
          <span v-for="pan in time.span" :key="pan.tab01">{{ pan.tab }}</span>
        </div>
        <div class="price">
          <span>{{ time.price }}</span
          >元/m²/天
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import axios from "axios";
export default {
  name: "Tui",
  data() {
    return {
      arr: [],
    };
  },
  created() {
    axios({
      url: "http://localhost:3000/Tui",
      params: {
        type: "Tui",
      },
    }).then((res) => {
      this.arr = res.data;
      console.log(this.arr);
    });
  },
};
</script>

<style scoped>
.box {
  height: 1.07rem;
  margin-left: 0.13rem;
  border-bottom: 2px solid #f8f8f8;
  display: flex;
  align-items: center;
}
.img {
  width: 0.9rem;
  height: 0.8rem;
  border: 1px solid #c5c5c6;
}
.txt {
  height: 0.84rem;

  flex: 1;
  margin-left: 0.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.txt h2 {
  font-size: 0.16rem;
  color: #000;
  font-weight: 700;
}
.txt p {
  font-size: 0.1rem;
  color: #262626;
  width: 2.6rem;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.span span {
  color: #a4b8e8;
  display: inline-block;
  background-color: #f3f7f9;
  font-size: 0.1rem;
  margin: 0 0.03rem;
  padding: 0.02rem 0.04rem;
}
.price {
  color: #f62e26;
  font-size: 0.1rem;
}
.price span {
  font-size: 0.14rem;
  font-weight: 900;
}
</style>
